package summer_vacation.qiuyangyang;

/**
 * Created by Administrator on 2015/8/26 0026.
 */
public class Assignment_18 {
    public static void main(String[] args) {


            double result=1;

            double a=1;
            int num=100;
            for(int i=2;i<=num;i++){
                if(i%2==0){
                    result=result-(a/i);
                }
                else{
                    result=result+(a/i);
                }
            }
            System.out.println("最后结果是："+result);
    }
}
